<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags"  prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'listDep.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

   <style type="text/css">
        .table1{
            border:1px solid #ddd;
            width:900px;
            
        }
        thead{
            background-color:lightblue;
        }

    </style>
  </head>
  
  <body>
<table border="0" width="900px">
<tr>
<td align="center" style="font-size:24px; color:#666"> 部门管理</td>
</tr>
<tr>
<td align="right" > <a href="<%=basePath%>department_saveUI.action">添加</a></td>
</tr>
</table>
<br/>
<table cellspacing="0" border="1" class="table1">
<thead>
   <tr>
   	<th width="450">部门名称</th><th  width="450">编辑</th>
   	<th  width="450">删除</th>
   </tr>
</thead>
<tbody>
<!--对取到的当前页的记录进行迭代显示  -->
<s:iterator value="list" var="d">
	<tr>
		<td align="center"><s:property value="#d.dname"/> </td>
		<td align="center"><a href="<%=basePath%>department_edit.action?did=<s:property value="#d.did"/>"><img src="<%=basePath%>images/编辑.png"/></a></td>
		<td align="center"><a href="<%=basePath%>department_delete.action?did=<s:property value="#d.did"/>">删除</a></td>
	</tr>
</s:iterator>
</tbody>
</table>
<br/>


<table border="0" cellspacing="0" cellpadding="0"  width="900px">
<tr>
<td align="right">
   <span>第<s:property value="currPage"/>/<s:property value="totalPage"/>页</span>&nbsp;&nbsp;
   <span>总记录数：<s:property value="totalCount"/></span>&nbsp;&nbsp;
   <span>每页显示记录数：<s:property value="pageSize"/>页</span>&nbsp;&nbsp;
   <span>
   <s:if test="currPage!=1">
       <a href="<%=basePath%>department_findAll.action?currPage=1">[首页]</a>&nbsp;&nbsp;
       <a href="<%=basePath%>department_findAll.action?currPage=<s:property value="currPage-1"/>">[上一页]</a>&nbsp;&nbsp;
   </s:if>
   <s:if test="currPage!=totalPage">
       <a href="<%=basePath%>department_findAll.action?currPage=<s:property value="currPage+1"/>">[下一页]</a>&nbsp;&nbsp;
       <a href="<%=basePath%>department_findAll.action?currPage=<s:property value="totalPage"/>">[尾页]</a>&nbsp;&nbsp;
   </s:if>
   </span>
</td>
</tr>
</table>
</body>
</html>
